<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<c:set value="recruit" var="moduleName" scope="request" />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>热点加盟城市列表</title>
</head>
<body>
	<div class="div-content">
		<dict:dict type="province,city,district" var="provincecitydistrict" />
		<script type="text/javascript">
var provincecitydistrict = eval('('+'<%=application.getAttribute("provincecitydistrict")%>'+')');
		</script>
		<form action="<c:url value='/console/recruit/townEx.do'/>"
			method="post">
			<table class="table-layout">
				<tr class="tr-odd">
					<td class="td-label">申请投资区域</td>
					<td><span id="dropContainer_0"> <input type="hidden"
							name="filter_EQS_provinceId"
							value="<c:out value="${filters.EQS_provinceId}" />" /> <select
							id="drop_0"></select> </span>省&nbsp;&nbsp; <span id="dropContainer_1">
							<input type="hidden" name="filter_EQS_cityId"
							value="<c:out value="${filters.EQS_cityId}" />" /> <select
							id="drop_1"></select> </span>市&nbsp;&nbsp; <span id="dropContainer_2">
							<input type="hidden" name="filter_EQS_districtId"
							value="<c:out value="${filters.EQS_districtId}" />" /> <select
							id="drop_2"></select> </span>区</td>
				</tr>
			</table>
			<br />
			<div class="right-opertion">
				<authz:authorize ifAnyGranted="admin,role_recruit_admin">
					<a href="<c:url value="/download/skoda_town_template.zip" />">下载导入模板</a>&nbsp;&nbsp;
					<input type="button" value="导入" onclick="showImportForm();"
						class="button" />&nbsp;&nbsp;
				</authz:authorize>
				<input type="button" value="搜索" onclick="search(this);"
					class="button" />
			</div>
			<div id="importFormContainer"></div>
			<br />
			<table class="table-layout">
				<tr class="tr-thead">
					<th style="width: 40px;">序号</th>
					<th><a href="javascript:void(0);"
						onclick="javascript:sort('provinceId',this)">省</a></th>
					<th>市</th>
					<th>区</th>
					<th style="width: 80px;"><a href="javascript:void(0);"
						onclick="javascript:sort('typeCode',this)">网络形态</a></th>
					<th style="width: 60px;"><a href="javascript:void(0);"
						onclick="javascript:sort('age',this)">计划年份</a></th>
					<th style="width: 60px;"><a href="javascript:void(0);"
						onclick="javascript:sort('amount',this)">计划数量</a></th>
					<authz:authorize ifAnyGranted="admin,role_recruit_admin">
						<th>操作</th>
					</authz:authorize>
				</tr>
				<logic:present name="page">
					<logic-el:iterate name="page" property="result" id="town"
						indexId="index">
						<tr
							class="<c:if test="${index % 2 == 0}">tr-odd</c:if><c:if test="${index % 2 == 1}">tr-even</c:if>">
							<td><c:out value="${index + 1}" /> &nbsp;</td>
							<td><authz:authorize ifAnyGranted="admin,role_recruit_admin">
									<a href="<c:url value='townEx.do?method=view&id=${town.id}'/>"><common:province
											name="town" property="provinceId" />
									</a>
								</authz:authorize> <authz:authorize ifNotGranted="admin,role_recruit_admin">
									<common:province name="town" property="provinceId" />
								</authz:authorize> &nbsp;</td>
							<td><common:city name="town" property="cityId" /> &nbsp;</td>
							<td><common:district name="town" property="districtId" />
								&nbsp;</td>
							<td><c:choose>
									<c:when test="${town.typeCode == '1'}">
									直营店
								</c:when>
									<c:when test="${town.typeCode == '2'}">
									特许经销商
								</c:when>
									<c:when test="${town.typeCode == '3'}">
									直营店或特许经销商
								</c:when>
								</c:choose></td>
							<td><c:out value="${town.age}" /></td>
							<td><c:out value="${town.amount}" /></td>
							<authz:authorize ifAnyGranted="admin,role_recruit_admin">
								<td><a
									href="<c:url value='townEx.do?method=edit&id=${town.id}'/>">修改</a>&nbsp;
									<span class="link"
									onclick="if(confirm('确定要删除该记录吗？')) location.href='<c:url value='townEx.do?method=erase&id=${town.id}'/>'">删除</span>&nbsp;
								</td>
							</authz:authorize>
						</tr>
					</logic-el:iterate>
				</logic:present>
			</table>
			<page:page name="page" />
		</form>
		<authz:authorize ifAnyGranted="admin,role_recruit_admin">
			<br />
			<div class="center-opertion">
				<input type="button"
					onclick="location.href='<c:url value='townEx.do?method=edit'/>'"
					value="添加" /> &nbsp;&nbsp;
			</div>
		</authz:authorize>
	</div>
	<form
		action="<c:url value="/console/recruit/townImport.do?method=ajaxSave" />"
		method="POST" id="importForm" enctype="multipart/form-data"
		style="display: none;" target="hiddenFrame">
		<input type="file" name="file" id="file" /> <input type="submit"
			value="提交" /> <input type="button" value="取消"
			onclick="hideImportForm()" />
	</form>
	<iframe name="hiddenFrame" style="display: none;"></iframe>
	<script type="text/javascript">
showDropDown(provincecitydistrict,["filter_EQS_provinceId","filter_EQS_cityId","filter_EQS_districtId"],"drop");
var importFormEl = _g("importForm");
function showImportForm(){
	_g("importFormContainer").appendChild(importFormEl);
	importFormEl.style.display="";
}
function hideImportForm(){
	importFormEl.style.display = "none";
	_g('bd').appendChild(importFormEl);
}

function successImport(jsonString){
	if(!refreshMessageJsonString(jsonString)) return false;
	hideImportForm();
}
	</script>
</body>
</html>
